package com.beyondsoft.sabg.edu.service.core;

import com.beyondsoft.sabg.edu.model.db.core.Role;
import com.beyondsoft.sabg.edu.model.db.core.UserAccount;
import com.beyondsoft.sabg.edu.model.dto.PrivilegeDTO;
import com.beyondsoft.sabg.edu.model.dto.UserAccountDTO;
import com.beyondsoft.sabg.edu.model.tree.PrivilegeTree;
import com.beyondsoft.sabg.edu.model.vo.core.UserInfoVO;
import com.beyondsoft.sabg.edu.repository.core.UserAccountRepo;
import com.beyondsoft.sabg.edu.service.SimpleService;

import java.util.List;

/**
 * @Author Mo cr
 * @Date 2023/8/4
 */
public interface UserAccountService extends SimpleService<UserAccount, UserAccountRepo> {
    UserInfoVO getCurrentUser();
    UserAccountDTO login(UserAccountDTO userAccountDTO);

    UserAccount findByUsername(String userName);

    List<PrivilegeTree> getPrivilegeTree();

    List<Long> getRolePrivilege(Long id);

    List<Role> getRoleList();

    void savePrivilege(PrivilegeDTO privilegeDTO);

    void updateRole(UserAccountDTO userAccountDTO);


    void deleteRoleById(Long roleId);


    String getXxcappToken();
    String getXxcappUser(String code);

    UserAccount autoRegister(UserAccount user);
}
